import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'; // 导入Pinia
// 1. 导入 Element Plus 组件
import ElementPlus from 'element-plus';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 2. 导入 Element Plus 样式文件（关键！缺失会导致 ElMessage 定位错误）
import 'element-plus/dist/index.css';
import lazyLoadDirective from './lazyLoadDirective';

const pinia = createPinia();

const app = createApp(App)


app.use(ElementPlus)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(pinia);
app.use(router)
app.use(lazyLoadDirective);
app.mount('#app')
